package GUI;

import java.awt.*;
import java.awt.geom.*;
import java.util.ArrayList;

import javax.swing.*;

import Program.Majn;

public class Pane extends JPanel{

ArrayList<Point2D> vertexes = new ArrayList<Point2D>();
ArrayList<Point2D> cons = new ArrayList<Point2D>();
ArrayList<Point2D> mk = new ArrayList<Point2D>();

double a=200;
double b=200;

double x1 = a-100;  double y1 = b;

double x2 = a+100;    double y2 = b;


public void paintComponent(Graphics g) {

super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.draw(new Ellipse2D.Double(a-100,b-100,a,b));
g2.setColor(Color.BLUE);
for(Point2D v : vertexes) {
	g2.fill(new Ellipse2D.Double(v.getX()-5, v.getY()-5 , 10 , 10));
}

for(Point2D c : cons) {
	g2.drawLine((int)vertexes.get((int) c.getX()).getX(), (int)vertexes.get((int) c.getX()).getY(), (int)vertexes.get((int) c.getY()).getX(), (int)vertexes.get((int) c.getY()).getY());

}
g2.setColor(Color.RED);
g2.drawString("Rozmiar Kliki: "+ Majn.mkliki.get(0).size(), 20, 20);
for(Point2D c : mk) {
	g2.drawLine((int)vertexes.get((int) c.getX()).getX(), (int)vertexes.get((int) c.getX()).getY(), (int)vertexes.get((int) c.getY()).getX(), (int)vertexes.get((int) c.getY()).getY());
	g2.fill(new Ellipse2D.Double((int)vertexes.get((int) c.getX()).getX()-5, (int)vertexes.get((int) c.getX()).getY()-5 , 10 , 10));
	g2.fill(new Ellipse2D.Double((int)vertexes.get((int) c.getY()).getX()-5, (int)vertexes.get((int) c.getY()).getY()-5 , 10 , 10));
}


}
}
